<?php

class LoginModel {
	static $session_login_uname = 'login.uname';
	
	static function getUname() {
		return Session::get(LoginModel::$session_login_uname);
	}
	
	static function setUname($uname) {
		return Session::set(LoginModel::$session_login_uname, $uname);
	}
	
	static function login($uname, $pwd) {
		if($uname == 'admin' && $pwd == 'admin') {
			self::setUname($uname);
			return true;
		} else {
			return false;
		}
	}
	
	static function logout() {
		Session::clear(LoginModel::$session_login_uname);
	}
}